home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11525 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: loading a new process using exec()
  5. Date: Sun, 24 Mar 96 21:09:35 GMT
  6. Organization: none
  7. Message-ID: <827701775snz@genesis.demon.co.uk>
  8. References: <0lJDsb200iol07bUU0@andrew.cmu.edu>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <0lJDsb200iol07bUU0@andrew.cmu.edu>
  15.            elie+@andrew.cmu.edu "Elie Jean-Philippe" writes:
  16.  
  17. >Hi all,
  18. >
  19. >I'm trying to load a program in a new process created using fork(). 
  20. >I'm using the following code (under HP-UX, 9.0):
  21. >
  22. >char *cmd_args[]  = {"test",NULL};
  23. >if (execl(cmd_args[0],cmd_args) < 0) {
  24.  
  25. fork() and execl() are Unix system functions, not C language function so have
  26. no meaning in comp.lang.c. You should discuss them in comp.unix.programmer.
  27.  
  28. On the systems I use execl is prototyped as:
  29.  
  30. int execl(const char *path, const char *arg, ...);
  31.  
  32. which your call clearly does not conform to. man execl, man execv.
  33.  
  34. -- 
  35. -----------------------------------------
  36. Lawrence Kirby | fred@genesis.demon.co.uk
  37. Wilts, England | 70734.126@compuserve.com
  38. -----------------------------------------
  39.